package com.triplelink.entity.sibling;

import java.util.ArrayList;
import java.util.List;

import resource.UrisClasses;
import resource.UrisSibling;

import com.triplelink.annotations.ClassType;
import com.triplelink.annotations.DatatypeProperty;
import com.triplelink.annotations.Id;
import com.triplelink.annotations.ObjectProperty;
import com.triplelink.annotations.Property;
import com.triplelink.enums.Datatype;

@ClassType(type = UrisClasses.SIBLING)
public class SiblingEntity
{
	@Id
	private String id;
	
	@DatatypeProperty(range = Datatype.STRING)
	@Property(uri = UrisSibling.NAME)
	private String name;
	
	@ObjectProperty(cascadeSave = true)
	@Property(uri = UrisSibling.HAS_SIBLING)
	private List<SiblingEntity> siblings;

	@ObjectProperty(cascadeSave = true)
	@Property(uri = UrisSibling.LIVES_IN_HOUSE)
	private HouseEntity livesIn;
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<SiblingEntity> getSiblings() {
		
		if (siblings == null)
			siblings = new ArrayList<SiblingEntity>();
		
		return siblings;
	}

	public void setSiblings(List<SiblingEntity> siblings) {
		this.siblings = siblings;
	}

	public HouseEntity getLivesIn() {
		return livesIn;
	}

	public void setLivesIn(HouseEntity livesIn) {
		this.livesIn = livesIn;
	}
}
